PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

MPSetTaskState

Sets state information for a suspended task.

OSStatus MPSetTaskState (
                     MPTaskID task,
                     MPTaskStateKind kind,
                     void *info);
task
A value of type MPTaskID that specifies the task whose state information you want to set.
kind
A value of type MPTaskStateKind that specifies the kind of state information you want to set. See Task State Constants for a listing of possible values. Note that some state information is read-only and cannot be changed using this function.
info
A pointer to a data structure holding the state information you want to set. The format of the data structure varies depending on the state information you want to set. See the header file MachineExceptions.h for the formats of the various state information structures.
function result
A result code. See Result Codes for a list of possible values. If you specify kMPTaskState32BitMemoryException for the state information, this function returns kMPInsufficientResourcesErr , since the exception state information is read-only. Attempting to set state information for a running task will also return kMPInsufficientResourcesErr .
DISCUSSION

You can use this function to set register contents or exception information for a particular task. However, some state information, such as the exception information (as specified by kMPTaskState32BitMemoryException ) as well as the MSR, ExceptKind, DSISR, and DAR machine registers (specified under kMPTaskStateMachine) are read-only. Attempting to set the read-only machine registers will do nothing, while attempting to set the exception information will return an error.

VERSION NOTES

Introduced with Multiprocessing Services 2.0.

SEE ALSO

The function MPExtractTaskState .


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)